package ssm.another;

import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by libing on 2016/12/13.
 */
public class HomeRegisterServiceImpl implements HomeRegisterService {

    @Autowired
    HomeRegisterMapper homeRegisterMapper;

    @Override
    public int checkExist(User user) throws Exception {
        return homeRegisterMapper.checkExist(user);
    }

    @Override
    public int registerUser(User user) throws Exception {
        user.setUser_key(user.getUser_password());//将密码加密的key设置为密码
       // user.setUser_password(EncryptUtil.SHA1(user.getUser_password()+EncryptUtil.SHA1(user.getUser_password())));//密码加密
        return homeRegisterMapper.registerUser(user);
    }
}
